using System.IO;
using Common;

namespace SProject.Rule
{
	public class MeltRule : Rule
	{
		public override Rule CreateRule()
		{
			return new MeltRule();
		}

		public override void Copy(Rule rule)
		{
			base.Copy(rule);
		}

		public override void SaveToStream(StreamEx stream)
		{
			base.SaveToStream(stream);
		}

		public override bool ReadFromStream(StreamEx stream)
		{
			if (base.ReadFromStream(stream))
			{
				while (true)
				{
					switch (stream.ReadKey())
					{
					case PropertyKey.Key_ExperimentICRule:
					{
						SimpleRule simpleRule = new SimpleRule();
						simpleRule.ReadFromStream(stream);
						break;
					}
					case PropertyKey.Key_SampleICRule:
					{
						SimpleRule simpleRule = new SimpleRule();
						simpleRule.ReadFromStream(stream);
						break;
					}
					case PropertyKey.Key_ResuleRule:
					{
						SimpleRule simpleRule = new SimpleRule();
						simpleRule.ReadFromStream(stream);
						break;
					}
					default:
						stream.Seek(-4L, SeekOrigin.Current);
						return true;
					}
				}
			}
			return false;
		}
	}
}
